﻿<!doctype html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>统计分析报表-监狱</title>
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css" />
    <link href="/static/js/laydate/theme/default/laydate.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        body {
            margin:0;
            padding:0;
            border:0;
            width:100%;
            height:100%;
            overflow:hidden;
        }
    </style>
</head>
<body>
<div class="role-search">
    <div class="mini-toolbar" style="padding:2px;border-top:0;border-left:0;border-right:0;">
        <table>
            <tr>
                <td style="width: 100%;">
                </td>
                <td style="white-space: nowrap;text-align:right;">
                    <input type="text" class="layui-input" id="yearKey" autocomplete="off" placeholder="年份">
                    <input id="quarterKey" class="mini-combobox" emptyText="季度" showNullItem='true'
                           data="[{ id: 1, name: '第一季度' },{ id: 2, name: '第二季度' },
                           { id: 3, name: '第三季度' },{ id: 4, name: '第四季度' }]"
                           textField="name" valueField="id" />
                    <#if level ?? && level ="09">
                        <input id="departKey" class="mini-combobox"
                               textField="departName" valueField="departId" emptyText="请选择..." showNullItem='true'
                               url="/azbj/statisticalreports/getJyData"
                        />
                    </#if>
                    <a class="mini-button" plain="true" iconCls="fa fa-search" plain="true" onclick="search()">统计</a>
                    <a class="mini-button" iconCls="fa-save" plain="true" onclick="exportExcelFile()">导出</a>
                </td>
            </tr>
        </table>
    </div>
</div>

<!--撑满页面-->
<div class="mini-fit">
    <div id="datagrid1" class="mini-datagrid" style="width: 100%; height: 100%;" ajaxType="get" multiSelect="false"
         sizeList="[20,50,100]" pageSize="50" virtualScroll="false" showPager="false" frozenStartColumn="0"
         idField="id" url="/azbj/statisticalreports/info/list">
        <div property="columns">
            <div header="刑期情况" headerAlign="center">
                <div property="columns">
                    <div field="xq1" width="120">死刑,缓期执行</div>
                    <div field="xq2" width="80">无期</div>
                    <div field="xq3" width="130">10-20年(含10年)</div>
                    <div field="xq4" width="130">3-10年(不含10年)</div>
                    <div field="xq5" width="100">不满3年</div>
                </div>
            </div>
            <div header="改造表现情况" headerAlign="center">
                <div property="columns">
                    <div field="gz1" width="80">好</div>
                    <div field="gz2" width="80">较好</div>
                    <div field="gz3" width="80">一般</div>
                    <div field="gz4" width="80">较差</div>
                    <div field="gz5" width="80">差</div>
                </div>
            </div>
            <div header="认罪态度情况" headerAlign="center">
                <div property="columns">
                    <div field="rztd1" width="120">认罪服法</div>
                    <div field="rztd2" width="100">服管不认罪</div>
                    <div field="rztd3" width="100">不认罪不服管</div>
                </div>
            </div>
            <div header="危险性评估情况" headerAlign="center">
                <div property="columns">
                    <div field="wxpg4" width="100">再犯罪</div>
                    <div field="wxpg5" width="100">特赦</div>
                    <div field="wxpg3" width="100">三无人员</div>
                    <div field="wxpg6" width="100">三假人员</div>
                    <div field="wxpg2" width="100">一般帮教对象</div>
                    <div field="wxpg1" width="100">重点帮教对象</div>
                </div>
            </div>
            <div header="预安置人员核查情况" headerAlign="center">
                <div property="columns">
                    <div field="hczt1" width="100">待核查</div>
                    <div field="hczt2" width="100">核查中</div>
                    <div field="hczt3" width="100">核查成功</div>
                    <div field="hczt4" width="100">核查失败</div>
                </div>
            </div>
            <div header="预释放人员衔接情况" headerAlign="center">
                <div property="columns">
                    <div field="xjzt1" width="100">衔接成功</div>
                    <div field="xjzt3" width="100">衔接失败</div>
                    <div field="xjzt4" width="100">未衔接</div>
                    <div field="xjzt5" width="100">待衔接</div>
                </div>
            </div>
        </div>
    </div>
</div>


<script src="/static/js/laydate/laydate.js" type="text/javascript"></script>
<script type="text/javascript">
    function max() {
        var nowDate = new Date();
        return nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
    }
    //常规用法
    //年选择器
    laydate.render({
        elem: '#yearKey'
        , type: 'year'
        ,max: max()
    });
    mini.parse();
    var grid = mini.get("datagrid1");
    /*var level =${level};
    if(1 != level){
        grid.setFrozenStartColumn(0);
        grid.setFrozenEndColumn(0);
    }*/

    function exportExcelFile() {
        var json = mini.encode(grid.data);
        var yearKey = $("#yearKey").val();
        if (yearKey == '') {
            mini.alert("请输入年份")
            return;
        }
        if (json == '') {
            return;
        }
        var quarterKey = mini.get("quarterKey").getValue();
        var departName = "-1";
        if (${level!''} == "09") {
            departName = mini.get("departKey").getText();
        }
        top.location.href = encodeURI("/azbj/statisticalreports/exportExcelFile?data="
            + json + "&yearKey=" + yearKey + "&quarterKey=" + quarterKey + "&departName=" + departName);
    }

    //查询
    function search() {
        var date = new Date();
        var yearKey = $("#yearKey").val();
        if (yearKey == '') {
            mini.alert("请输入年份")
            return;
        }
        if (yearKey > date.getFullYear()) {
            mini.alert("年份不符合要求")
            return;
        }
        var quarterKey = mini.get("quarterKey").getFormValue();
        var departId = "-1"
        if (${level!''} == "09") {
            departId = mini.get("departKey").getFormValue();
        }
        grid.load({yearKey: yearKey, quarterKey: quarterKey, departid: departId});
    }
</script>
<script src="/static/js/common/common.js" type="text/javascript"></script>
</body>
</html>